package com.xcity.pomelo.push.msg;

import java.util.ArrayList;
import java.util.List;

import com.xcity.db.entity.Player;
import com.xcity.pomelo.PomeloRoute;
import com.xcity.pomelo.push.AbstractMessagePush;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.PUSH, route = PomeloRoute.PUSH_MESSAGE)
public class VisitorInPush extends AbstractMessagePush {

	private List<Visitor> visitors;
	
	public static class Visitor {
		private long roleId;
		private String roleName;
		private String img;
		private int lv;
		private byte sex;
		public Visitor(Player visitor) {
			this.roleId = visitor.getId();
			this.roleName = visitor.getName();
			this.img = visitor.getIcon();
			this.lv = visitor.getLevel();
			this.sex = visitor.getSex();
		}
		public long getRoleId() {
			return roleId;
		}
		public String getRoleName() {
			return roleName;
		}
		public String getImg() {
			return img;
		}
		public int getLv() {
			return lv;
		}
		public byte getSex() {
			return sex;
		}
	}
	
	public VisitorInPush(Player visitor) {
		super(MSG_VISITOR_IN);
		List<Visitor> list = new ArrayList<Visitor>(1);
		list.add(new Visitor(visitor));
		this.visitors = list;
	}

	public List<Visitor> getVisitors() {
		return visitors;
	}

}
